package com.chushouya.manager.dto.admin.bonustype;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel("添加红包")
public class BonusTypeSaveDTO {

    @ApiModelProperty(value = "名称", required = true)
    @NotBlank(message = "名称不能为空")
    private String typeName;

    @ApiModelProperty(value = "金额", required = true)
    @Min(value = 0, message = "红包金额不能小于0")
    private BigDecimal typeMoney;

    @ApiModelProperty(value = "最低使用金额", required = true)
    @NotNull(message = "最低使用金额不能为空")
    private BigDecimal minAmount;

    @ApiModelProperty(value = "发放类型 1、按用户发放 2、按商品发放 3、按订单金额发放 4、线下发放的红包 BonusTypeSendTypeEnum", required = true)
    @Min(value = 1, message = "发放类型不正确")
    @Max(value = 4, message = "发放类型不正确")
    private Integer sendType;

    @ApiModelProperty(value = "使用起始日期", required = true)
    private Date startTime;

    @ApiModelProperty(value = "使用结束日期", required = true)
    private Date endTime;

    @ApiModelProperty(value = "卡券有效期", required = true)
    @Min(value = 1, message = "卡券有效期不能小于1")
    private Integer useDay;

    @ApiModelProperty(value = "券类型 1、回收券 2、优品券", required = true)
    @Min(value = 1, message = "券类型不正确")
    @Max(value = 2, message = "券类型不正确")
    private Integer bonusType;

    @ApiModelProperty("使用此券的产品id,多个逗号分隔, 例如 [1,2,3]")
    private String productIds;

    @ApiModelProperty("使用此券的分类id,多个逗号分隔, 例如 [1,2,3]")
    private String categoryIds;

}
